package com.ydlclass.config;

import com.ydlclass.bean.Dog;
import org.springframework.context.MessageSource;
import org.springframework.context.annotation.*;
import org.springframework.context.support.ResourceBundleMessageSource;

@Configuration
@PropertySource("classpath:app.properties")
@EnableAspectJAutoProxy
public class AppConfiguration {

	@Bean
	@Profile("dev")
	public Dog dog1(){
		return new Dog("yellow", 2);
	}

	@Bean
	@Profile("test")
	public Dog dog2(){
		return new Dog("red", 2);
	}

	@Bean
	public MessageSource messageSource(){
		return new ResourceBundleMessageSource();
	}

}
